package com.neusoft.tijiancms.controller;

import com.neusoft.tijiancms.po.Cireport;
import com.neusoft.tijiancms.po.Orders;
import com.neusoft.tijiancms.service.CireportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/CireportController")
public class CireportController {
    @Autowired
    private CireportService cireportService;

    /**
     * 请求地址：http://localhost:8088/tijiancms/CireportController/createReportTemplate
     * 创建模板
     * @param orders
     * @return
     */
    @RequestMapping("/createReportTemplate")
    public int createReportTemplate(@RequestBody Orders orders){
        return cireportService.createReportTemplate(orders);
    }

    @RequestMapping("/listCireport")
    public List<Cireport> listCireport(@RequestBody Cireport cireport){
        return cireportService.listCireport(cireport.getOrderId());
    }
}
